package org.cpoy.ei.session;

import org.cpoy.eims.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("studentExtraDetailsList")
public class StudentExtraDetailsList extends EntityQuery<StudentExtraDetails> {

	private static final String EJBQL = "select studentExtraDetails from StudentExtraDetails studentExtraDetails";

	private static final String[] RESTRICTIONS = {
			"lower(studentExtraDetails.nationality) like lower(concat(#{studentExtraDetailsList.studentExtraDetails.nationality},'%'))",
			"lower(studentExtraDetails.motherTongue) like lower(concat(#{studentExtraDetailsList.studentExtraDetails.motherTongue},'%'))",
			"lower(studentExtraDetails.gender) like lower(concat(#{studentExtraDetailsList.studentExtraDetails.gender},'%'))",
			"lower(studentExtraDetails.bloodGroup) like lower(concat(#{studentExtraDetailsList.studentExtraDetails.bloodGroup},'%'))",
			"lower(studentExtraDetails.remarks) like lower(concat(#{studentExtraDetailsList.studentExtraDetails.remarks},'%'))", };

	private StudentExtraDetails studentExtraDetails = new StudentExtraDetails();

	public StudentExtraDetailsList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public StudentExtraDetails getStudentExtraDetails() {
		return studentExtraDetails;
	}
}
